package com.gonsin.ta.logic.enums;

/**
 * 节点类型枚举
 */
public enum ConditionTypeEnum {
    RUN("RUN","执行方法"),
    SWITCH("SWITCH", "选择方法"),
    WAIT("WAIT", "等待方法"),
    ;
    private String code;
    private String name;

    ConditionTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static ConditionTypeEnum getEnumByCode(String code) {
        for (ConditionTypeEnum e : ConditionTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }
}
